#include "stdafx.h"
#include "CGroupBase.h"

CGroupBase::CGroupBase()
	: m_iGroupIndex(0), m_bChecked(false)
{

}
CGroupBase::~CGroupBase()
{

}

void CGroupBase::SetGroupIndex(int_32 iGroupIndex)
{
	m_iGroupIndex = iGroupIndex;
}
int_32 CGroupBase::GetGroupIndex() const
{
	return m_iGroupIndex;
}

void CGroupBase::SetGroupChecked(bool bChecked)
{
	if(bChecked != m_bChecked)
	{
		m_bChecked = bChecked;
		if(bChecked)
		{
			IControl * pControl = GetGroupControl();
			VerifyPointer(pControl);
			IControl * pParent = pControl->GetParent();
			VerifyPointer(pParent);
			IContainer * pContainer = pParent->GetContainer();
			VerifyPointer(pContainer);
			pContainer->OnCheckedGroup(this);
		}
		CheckedChanged();
	}
}
bool CGroupBase::IsGroupChecked() const
{
	return m_bChecked;
}
